package Book;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-02-28
 * Time: 11:06
 */
public class Book {
    private String name;
    private String Writer;
    private int price;
    private String type;
    private boolean exist;

    public Book(String name, String writer, int price, String type, boolean exist) {
        this.name = name;
        Writer = writer;
        this.price = price;
        this.type = type;
        this.exist = exist;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getWriter() {
        return Writer;
    }

    public void setWriter(String writer) {
        Writer = writer;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isExist() {
        return exist;
    }

    public void setExist(boolean exist) {
        this.exist = exist;
    }

    @Override
    public String toString() {
        return "Book{" +
                "name='" + name + '\'' +
                ", Writer='" + Writer + '\'' +
                ", price=" + price +
                ", type='" + type + '\'' +
                ", exist=" + (exist == true? "未借出" : "已借出") +
                '}';
    }
}
